home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
MACSHELL
/
MS1
/
UTILS
/
ERROR.C
next >
Wrap
Text File
|
1992-12-02
|
6KB
|
170 lines
/*
* MacShell Source File
*
* Copyright (c) 1989, 1990, 1991, 1992 Suick Bay Technologies. All rights reserved.
*
*
* RESTRICTIONS ON MacShell program and source code.
*
* Ñ╩MacShell¬ is a product of Suick Bay Technologies and is provided for
* restricted use by the owner of the CDROM "Disk to the future II".
*
* Ñ╩No permission is granted for any commercial use without the written
* consent of the Suick Bay Technologies.
*
* Ñ╩No permission is granted for any redistribution of any kind use without
* the written consent of the Suick Bay Technologies.
*
* Ñ╩Permission is granted to use this for any personal noncommercial use.
*
* Ñ╩You may not distribute source or executable code at all, nor may you
* distribute it with or within a commercial product without the written
* consent of the Suick Bay Technologies. Please send modifications to
* the author for inclusion in updates to the program. Thanks.
*
*
* MacShell¬ IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* SUICK BAY TECHNOLOGIES SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY MACSHELL
* OR ANY PART THEREOF.
*
* In no event will Suick Bay Technologies be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Suick Bay Technologies has been advised of the possibility of such damages.
*
* Suick Bay Technologies can be reached at:
*
* 8768 Cottonwood lane
* Maple Grove, MN 55369
* Voice: (612) 425-7025
* AppleLink: D5233
*
*
* No parts of this software may be reproduced or stored in a
* retrieval system or transmitted in any form, or any means,
* electronic, mechanical, photocopying, recording or otherwise,
* without the prior written permission of Suick Bay Technologies.
*
* Spread the word and not the disk.
*
* SPK 012290 : Initial
*/
FileError( err )
OsErr err;
{
char *errStr;
if( err == noErr )
return;
switch( err )
{
case fsDSIntErr : errStr = "Internal file system error"; break;
case volGoneErr : errStr = "Server volume has been disconnected."; break;
case wrgVolTypErr: errStr = "Wrong volume type error [operation not supported for MFS]"; break;
case badMovErr : errStr = "Move into offspring error"; break;
case tmwdoErr : errStr = "No free WDCB available"; break;
case dirNFErr : errStr = "Directory not found"; break;
case wrPermErr : errStr = "Write permissions error"; break;
case badMDBErr : errStr = "Bad master directory block"; break;
case fsRnErr : errStr = "File system internal error:during rename the old entry was deleted but could not be restored."; break;
case extFSErr : errStr = "Volume in question belongs to an external fs"; break;
case noMacDskErr : errStr = "Not a mac diskette (sig bytes are wrong)"; break;
case nsDrvErr : errStr = "No such drive (tried to mount a bad drive num)"; break;
case volOnLinErr : errStr = "Drive volume already on-line at MountVol"; break;
case permErr : errStr = "Permissions error (on file open)"; break;
case volOffLinErr: errStr = "Volume not on line error (was Ejected)"; break;
case gfpErr : errStr = "Get file position error"; break;
case rfNumErr : errStr = "Refnum error"; break;
case paramErr : errStr = "Error in user parameter list"; break;
case opWrErr : errStr = "File already open with with write permission"; break;
case dupFNErr : errStr = "Duplicate filename (rename)"; break;
case fBsyErr : errStr = "File is busy (delete)"; break;
case vLckdErr : errStr = "Volume is locked"; break;
case fLckdErr : errStr = "File is locked"; break;
case wPrErr : errStr = "Diskette is write protected."; break;
case fnfErr : errStr = "Not found"; break;
case tmfoErr : errStr = "Too many files open"; break;
case mFulErr : errStr = "Memory full (open) or file won't fit (load)"; break;
case posErr : errStr = "Tried to position to before start of file (r/w)"; break;
case eofErr : errStr = "End of file"; break;
case fnOpnErr : errStr = "File not open"; break;
case bdNamErr : errStr = "Bad name"; break;
case ioErr : errStr = "I/O error"; break;
case nsvErr : errStr = "No such volume"; break;
case dskFulErr : errStr = "Disk full"; break;
case dirFulErr : errStr = "Directory full"; break;
default : errStr = "Unknown"; break;
}
printf( "File Error %d : %s\n", err, errStr );
}
ResourceError( err )
OsErr err;
{
char *errStr;
if( err == noErr )
return;
switch( err )
{
case mapReadErr : errStr = "map inconsistent with operation"; break;
case resAttrErr : errStr = "attribute inconsistent with operation"; break;
case rmvRefFailed :
case rmvResFailed : errStr = "RmveResource failed"; break;
case addRefFailed :
case addResFailed : errStr = "AddResource failed"; break;
case resFNotFound : errStr = "Resource file not found"; break;
case resNotFound : errStr = "Resource not found"; break;
default : errStr = "Unknown"; break;
}
printf( "Resource Error %d : %s\n", err, errStr );
}
MemoryError()
{
char *errStr;
int err;
long memLeft;
err = MemError();
switch ( err )
{
case memFullErr :
memLeft = FreeMem();
printf ( "memory error: memFullErr (-108) { not enough room in heap zone }; %ld bytes remaining\n", memLeft );
break;
case memLockedErr :
printf ( "memory error: memLockedErr (-117) { block is locked }\n" );
break;
case memPurErr :
printf ( "memory error: memPurErr (-112) { attempt to purge a locked block }\n" );
break;
case memWZErr :
printf ( "memory error: memWZErr (-111) { attemp to operate on a free block }\n" );
break;
case nilHandleErr :
printf ( "memory error: nilHandleErr (-109) { NIL master pointer }\n" );
break;
case noErr :
return;
break;
default :
printf ( "memory error: (%d)\n", err );
break;
}
}